<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
     

<h:head>
        <title>Central de Estagio Administração</title>
	<style> 
	.ui-widget, 
	.ui-widget .ui-widget { 
		font-size: 12px !important; 
	}
	.ui-layout-north{
		z-index:20 !important;
		overflow:visible !important;
	}
	.ui-layout-north .ui-layout-unit-content{
	    overflow:visible !important;
	}
	.semBorda tr, .semBorda td {  
    border: none !important;  
	}  
	</style>
</h:head>
<body>
      
      
      
      <div align="left">
<h:form id="list">
	<p:panel header="PESQUISAR FUNCIONÁRIO">  
        <h:panelGrid columns="2" cellpadding="5"> 
        	<h:outputText value="Nome: " />  
            <p:inputText value="#{MBFuncionario.listaFuncionario}"/>     
        </h:panelGrid> 
            <p:commandButton value="Pesquisar" align="center" action="#{MBFuncionario.funcionario}" update="tbFuncionario"/> 
    </p:panel>
    <br />
    <p:dataTable id="tbFuncionario" value="#{MBFuncionario.listaFuncionario}" var="funcionario"  emptyMessage="Nenhum registro encontrado!"> 
        <f:facet name="header">FUNCIONÁRIOS</f:facet>  
  
        <p:column>  
            <f:facet name="header">Registro</f:facet>  
            <h:outputText value="#{funcionario.registroFunc}" />    
        </p:column>  
  
        <p:column headerText="Nome">  
            <h:outputText value="#{funcionario.nomeFunc}" />  
        </p:column>  
  
        <p:column headerText="Perfil">  
            <h:outputText value="#{funcionario.perfilFunc}" /> 
        </p:column>  
  
        <p:column headerText="Situação">  
            <h:outputText value="#{funcionario.situacaoFunc}" />  
        </p:column>
        <p:column>  
        <div align="center"> 
        	      
        	<p:commandButton icon="ui-icon-pencil" title="Editar" action="#{MBFuncionario.prepararUp()}" immediate="true"  ajax="false" />
        	<p:commandButton icon="ui-icon-trash" title="Remover" action="#{MBFuncionario.delete()}" oncomplete="excluirConfirm.show()" update="list"/>  
       		
        </div>
        </p:column>  
    </p:dataTable>
    
	<p:confirmDialog widgetVar="excluirConfirm" message="Deseja Excluir?" header="Excluir Funcionario" severity="alert" modal="true"
		position="center" closable="false" height="50" width="300" resizable="false">
		<div align="center">
		<p:commandButton value="Sim" action="#{MBFuncionario.delete()}" oncomplete="excluirConfirm.hide()"  />
		<p:commandButton value="Não" onclick="excluirConfirm.hide()"/>
		</div>
	</p:confirmDialog>

</h:form>
</div>
</body> 
</html>